{{define "title"}}Post List{{end}}

{{define "body"}}
<table id="post-table" class="table table-bordered table-hover">
  <thead>
    <tr>
      <th>ID</th><th>Published</th><th>Title</th><th>Category</th><th>Tag</th><th>View</th>
    </tr>
  </thead>
  <tbody>
{{range $i,$p := .Posts}}
    <tr>
      <td>{{$i}}</td><td>{{ $p.Published }}</td><td><a href="./post/edit?id={{$p.ID}}" title="{{$p.Title}}">{{$p.Title}}</a></td><td>{{with $p.CategoryTerm}}{{.Name}}{{end}}</td><td>{{$p.Tags}}</td><td> {{if $p.Published }}<a href="/post?id={{$p.ID}}" title="View Post">View</a>{{end}}</td>
    </tr>
{{else}}
    <tr>
      <td colspan="4">no post found</td>
    </tr>
{{end}}
  </tbody>
</table>
  <a href="{{ .LogoutUrl }}">Logout</a>
{{end}}

{{define "extrahead"}}{{end}}

{{define "extrabody"}}{{end}}
